<template>
    <!--翻转字符-->
    <div>
        <h1>{{ msg  }}</h1>
        <button @click="msgbtn">点击翻转字符</button>
    </div>
</template>

<script setup>
import { ref } from 'vue'
const msg = ref('hello world')

const msgbtn = () => { 
    console.log(msg.value.split('').reverse().join(''));
   msg.value= msg.value.split('').reverse().join('')
}

</script>

<style  scoped>

</style>